
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>FreeMarker Index</title>

    <link href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/style.css"/>
    
    <script>
		function lessNum(obj)
		{
			if(parseInt(obj.parentElement.children[1].innerHTML)<=1)
			{
				obj.parentElement.children[1].innerHTML=1;
				alert("商品数量至少为1，不能再减了");
			}
			else
			{
				obj.parentElement.children[1].innerHTML=parseInt(obj.parentElement.children[1].innerHTML)-1;
			
			}
		}
		
		function moreNum(obj)
		{
			if(parseInt(obj.parentElement.children[1].innerHTML)==parseInt(obj.parentElement.children[3].innerHTML))
			{
				alert("库存不足了，不能再加了");
			}
			else
			{
				obj.parentElement.children[1].innerHTML=parseInt(obj.parentElement.children[1].innerHTML)+1;
			}
			
		}

	</script>
  </head>

  <body>

	
   <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>

 		<div class="navbar-brand" Left="400px">卖家您好，${sys_user_key.account}</div>
	          <a class="navbar-brand" href="/system/logout">[退出]</a>
        </div>
       <div id="navbar" class="navbar-collapse collapse">
          	<form class="navbar-form navbar-right">
			<a class="navbar-brand" href="/seller/index/all">首页</a>
			
            <a class="navbar-brand" href="/seller/public">发布</a>
            
 			</form>
       </div><!--/.navbar-collapse -->
          
        
      </div>
    </nav>

<div class="g-doc">
   <div class="m-tab m-tab-fw m-tab-simple f-cb">
        <h2>内容编辑</h2>
    </div>
    <div class="n-public">
        <form class="m-form m-form-ht" id="form" method="post" action="/seller/editSubmit?id=${commodity.id}" onsubmit="return false;" autocomplete="off">
            <div class="fmitem">
                <label class="fmlab">标题：</label>
                <div class="fmipt">
                    <input type="hidden" name="id" value="${commodity.id}"/>
                    <input class="u-ipt ipt" name="title" value="${commodity.title}" />
                </div>
            </div>
            <div class="fmitem">
                <label class="fmlab">摘要：</label>
                <div class="fmipt">
                    <input class="u-ipt ipt" name="summary" placeholder="2-140字符" value="${commodity.summary}" />
                </div>
            </div>
            <div class="fmitem">
            <label class="fmlab">图片：</label>
            	<div class="fmipt" id="uploadType">
	                <input name="pic" type="radio" value="url" checked /> 图片地址
					<input name="pic" type="radio" value="file" /> 本地上传
				</div>	
            </div>
            <div class="fmitem">
                <label class="fmlab"></label>
                <div class="fmipt" id="urlUpload">
                    <input class="u-ipt ipt"  name="image" value="${commodity.picture}" placeholder="图片地址"/>
                </div>
                <div class="fmipt" id="fileUpload"  style="display:none">
                    <input class="u-ipt ipt" name="file" type="file" id="fileUp"/>
                    <button class="u-btn u-btn-primary" id="upload">上传</button>
                </div>
            </div>
            <div class="fmitem">
                <label class="fmlab">正文：</label>
                <div class="fmipt">
                    <textarea class="u-ipt" name="detail" rows="10" placeholder="2-1000个字符">${commodity.content}</textarea>
                </div>
            </div>
            <div class="fmitem">
                <label class="fmlab">价格：</label>
                <div class="fmipt">
                    <input class="u-ipt price" name="price" value="${commodity.price}" />元
                </div>
            </div>
            
             <div class="fmitem">
                <label class="fmlab">库存：</label>
                <div class="fmipt">
                    <input class="u-ipt price" name="remainningAmount" value="${commodity.remainningAmount}" />件
                </div>
            </div>
            <div class="fmitem fmitem-nolab fmitem-btn">
                <div class="fmipt">
                    <button type="submit" class="u-btn u-btn-primary u-btn-lg">保 存</button>
                </div>
            </div>
        </form>
        <span class="imgpre"><img src="${commodity.picture}" alt="" id="imgpre"></span>
    </div>

</div>


<div class="n-foot">
 <#include "/footer.ftl">
</div>
    <!-- Bootstrap core JavaScript -->
    <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/js/global.js"></script>
	<script type="text/javascript" src="/js/public.js"></script>
  </body>
</html>